using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog;

namespace OpenAdmin.HttpApi
{
    /// <summary>
    /// 
    /// </summary>
    public class Program
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                //.UseSerilog(config =>
                //{
                //    config
                //    .MinimumLevel.Debug()
                //    //.MinimumLevel.Override("Default", LogEventLevel.Warning)
                //    //.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
                //    //.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
                //    .WriteTo.Console()
                //    .WriteTo.Exceptionless();
                //})
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>().InjectAgility();
                });
    }
}
